package client

import com.fasterxml.jackson.annotation.JsonCreator
import com.fasterxml.jackson.annotation.JsonProperty

data class VCoreSkillEntry @JsonCreator constructor(
        @JsonProperty("vcoreid") var vcoreid: Int = 0,
        @JsonProperty("level") var level: Int = 0,
        @JsonProperty("exp") var exp: Int = 0,
        @JsonProperty("skill1") var skill1: Int = 0,
        @JsonProperty("skill2") var skill2: Int = 0,
        @JsonProperty("skill3") var skill3: Int = 0,
        @JsonProperty("dateExpire") var dateExpire: Long,
        @JsonProperty("slot") var slot: Int = 0,
        @JsonProperty("index") var index: Int
) {

    fun getType(): Int {
        return vcoreid / 10000000 - 1
    }

    fun gainExp(exp: Int) {
        this.exp += exp
    }

    fun levelUP() {
        if (level >= 25) {
            level = 25
            exp = 0
            return
        }
        ++this.level
    }

    fun getSkill(slot: Int): Int {
        return when (slot) {
            1 -> skill1
            2 -> skill2
            3 -> skill3
            else -> 0
        }
    }
}

object VMatrixOptionBans {
    var slotMax = 0
    var equipSlotMin = 0
    var equipSlotMax = 0
    var specialSlotMax = 0
    var extendLevel = 0
    var extendAF = 0
    var gradeMax = 0
    var totalGradeMax = 0
    var craftSkillCoreCost = 0
    var craftEnchantCoreCost = 0
    var craftSpecialCoreCost = 0
    var craftGemstoneCost = 0
    var matrixPointResetMeso = 0
    var equipSlotEnhanceMax = 0
    var slotExpansionMesos = HashMap<Int, HashMap<Int, Int>>()
}

data class VMatrixSlotEntry @JsonCreator constructor(@JsonProperty("slot") var slot: Int = 0) {
    var index = -1
    var extend = 0
    var unlock = 0
}